---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.1.log
  log type:  text
 opened on:  12 May 2025, 18:03:26

. 
. use "C:\Users\sbstjp\OneDrive - Cardiff University\anes_timeseries_2020_stata_20220210.dta" // American Natio
> nal Election Study 2020 Time Series Study, Feb 10, 2022 Version. Date accessed: March 09, 2025. Accessed from
>  https://electionstudies.org/data-center/2020-time-series-study/

. 
. // Social justice scale 
. *Delete missing values
. rename V201411x tgpolicy 

. replace tgpolicy = . if tgpolicy == -2
(313 real changes made, 313 to missing)

. rename V201626 offence 

. replace offence = . if inlist(offence, -5, -9)
(176 real changes made, 176 to missing)

. rename V202183 metoo 

. replace metoo = . if inlist(metoo, -9, -7, -6, -5, -4, 998, 999)
(2,122 real changes made, 2,122 to missing)

. rename V202174 blm 

. replace blm = . if inlist(blm, -9, -7, -6, -5, -4, 998, 999)
(936 real changes made, 936 to missing)

. 
. *Reverse code offence so social justice values are high
. egen maxval = max(offence)

. gen roffence = maxval + 1 - offence
(176 missing values generated)

. drop maxval

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in tgpolicy roffence metoo blm {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    tgpolicy |      7,967    3.470692    2.007609          1          6
(313 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    roffence |      8,104    2.429911    1.106463          1          4
(176 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
       metoo |      6,158    59.02891    29.87323          0        100
(2,122 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
         blm |      7,344    53.29562    35.43163          0        100
(936 missing values generated)

. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in stgpolicy sroffence smetoo sblm  {
  2.     replace `var' = 0 if missing(`var')
  3. }
(313 real changes made)
(176 real changes made)
(2,122 real changes made)
(936 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in stgpolicy sroffence smetoo sblm  {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(7,967 real changes made)
(7,967 real changes made)
(8,104 real changes made)
(8,104 real changes made)
(6,158 real changes made)
(6,158 real changes made)
(7,344 real changes made)
(7,344 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen SocJusValues = .
(8,280 missing values generated)

. replace SocJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(8,262 real changes made)

. 
. // Demographic variables
. * Delete missing values
. rename V201507x age 

. replace age = . if age == -9
(348 real changes made, 348 to missing)

. 
. rename V201617x income 

. replace income = . if inlist(income, -9, -5)
(616 real changes made, 616 to missing)

. 
. rename V201600 FemaleGender 

. replace FemaleGender = . if FemaleGender == -9
(67 real changes made, 67 to missing)

. 
. rename V201510 education 

. replace education = . if inlist(education, -9, -8, 95)
(131 real changes made, 131 to missing)

. 
. rename V201549x race

. replace race = . if inlist(race, -9, -8)
(102 real changes made, 102 to missing)

. 
. rename V201200 libconsp 

. replace libconsp = . if inlist(libconsp, -9, -8, 99)
(1,224 real changes made, 1,224 to missing)

. 
. *Create dummy variables
. gen Graduate=.
(8,280 missing values generated)

. replace Graduate=0 if education<6
(4,502 real changes made)

. replace Graduate=1 if inrange(education, 6, 8)
(3,647 real changes made)

. 
. gen BIPOC=. 
(8,280 missing values generated)

. replace BIPOC=0 if race==1
(5,963 real changes made)

. replace BIPOC=1 if inrange(race, 2, 6)
(2,215 real changes made)

. 
. // Liberalism scale
. *Delete missing values
. rename V201415 gayadopt

. replace gayadopt = . if inlist(gayadopt, -8, -9)
(128 real changes made, 128 to missing)

. rename V201336 abortion

. replace abortion = . if inlist(abortion, -8, -9, 5) 
(380 real changes made, 380 to missing)

. rename V201262 environment

. replace environment = . if inlist(environment, -9, -8, 99)
(1,156 real changes made, 1,156 to missing)

. rename V202232 immigration

. replace immigration = . if inlist(immigration, -9, -8, -7, -6, -5) 
(930 real changes made, 930 to missing)

. rename V201345x deathpen

. replace deathpen = . if inlist(deathpen, -2) 
(167 real changes made, 167 to missing)

. rename V201426x wall

. replace wall = . if inlist(wall, -2) 
(40 real changes made, 40 to missing)

. rename V201308x bordersec

. replace bordersec = . if inlist(bordersec, -2) 
(53 real changes made, 53 to missing)

. rename V201311x crime

. replace crime = . if inlist(crime, -2) 
(54 real changes made, 54 to missing)

. 
. *Reverse variables so liberalism coded high
. foreach var in gayadopt immigration environment {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(128 missing values generated)
(930 missing values generated)
(1,156 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in rgayadopt abortion renvironment rimmigration deathpen wall bordersec crime {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   rgayadopt |      8,152    1.803974    .3970124          1          2
(128 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    abortion |      7,900    3.045696    1.090679          1          4
(380 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
renvironment |      7,124    4.917462    1.981363          1          7
(1,156 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rimmigration |      7,350    3.008435    1.137414          1          5
(930 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    deathpen |      8,113    2.175521    1.151282          1          4
(167 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
        wall |      8,240     4.29551    2.473342          1          7
(40 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   bordersec |      8,227    2.646651    1.344673          1          5
(53 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
       crime |      8,226    2.269998    1.162187          1          5
(54 missing values generated)

. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in srgayadopt sabortion srenvironment srimmigration sdeathpen swall sbordersec scrime {
  2.     replace `var' = 0 if missing(`var')
  3. }
(128 real changes made)
(380 real changes made)
(1,156 real changes made)
(930 real changes made)
(167 real changes made)
(40 real changes made)
(53 real changes made)
(54 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreAL = 0

. gen count_nonzeroAL = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in srgayadopt sabortion srenvironment srimmigration sdeathpen swall sbordersec scrime {
  2.     replace total_scoreAL = total_scoreAL + `var'
  3.     replace count_nonzeroAL = count_nonzeroAL + (`var' != 0)
  4. }
(8,152 real changes made)
(8,152 real changes made)
(7,900 real changes made)
(7,900 real changes made)
(7,124 real changes made)
(7,124 real changes made)
(7,350 real changes made)
(7,350 real changes made)
(8,113 real changes made)
(8,113 real changes made)
(8,240 real changes made)
(8,240 real changes made)
(8,227 real changes made)
(8,227 real changes made)
(8,226 real changes made)
(8,226 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen LibValues = .
(8,280 missing values generated)

. replace LibValues = total_scoreAL / count_nonzeroAL if count_nonzeroAL > 0
(8,277 real changes made)

. 
. // Democracy variables
. 
. *Delete missing values
. replace V201366 = . if inlist(V201366, -9, -8) 
(57 real changes made, 57 to missing)

. replace V201367 = . if inlist(V201367, -9, -8) 
(37 real changes made, 37 to missing)

. 
. *Standardize items in the scale from 1-2, so coefficients can be compared to others in book
. foreach var in V201366 V201367 {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     V201366 |      8,223     3.72127    1.323733          1          5
(57 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     V201367 |      8,243    4.353755    .8842533          1          5
(37 missing values generated)

. 
. *Rename
. rename sV201366 NewsOrgs

. rename sV201367 BranchesOfGov

. 
. // Standardize variables 
. egen Age = std(age)
(348 missing values generated)

. egen Income = std(income)
(616 missing values generated)

. 
. // Regressions
. regress NewsOrgs LibValues [pweight=V200010b], robust 
(sum of wgt is 7,414.42047423692)

Linear regression                               Number of obs     =      7,404
                                                F(1, 7402)        =     673.20
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1523
                                                Root MSE          =     .30593

------------------------------------------------------------------------------
             |               Robust
    NewsOrgs | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |    .565443   .0217931    25.95   0.000     .5227224    .6081635
       _cons |   .7964762   .0347758    22.90   0.000     .7283058    .8646467
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress NewsOrgs LibValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robust 
(sum of wgt is 6,710.25460426805)

Linear regression                               Number of obs     =      6,669
                                                F(6, 6662)        =     184.91
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2175
                                                Root MSE          =     .29453

------------------------------------------------------------------------------
             |               Robust
    NewsOrgs | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .5677633   .0236265    24.03   0.000     .5214478    .6140788
         Age |   .0437889   .0055126     7.94   0.000     .0329825    .0545952
FemaleGender |  -.0751786    .010401    -7.23   0.000    -.0955678   -.0547893
    Graduate |   .0873896   .0107164     8.15   0.000     .0663819    .1083972
      Income |   .0303383   .0055947     5.42   0.000      .019371    .0413057
       BIPOC |   .0071937   .0115175     0.62   0.532    -.0153843    .0297717
       _cons |   .8775175   .0394427    22.25   0.000     .8001971    .9548379
------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress NewsOrgs SocJusValues [pweight=V200010b], robust 
(sum of wgt is 7,407.43057996028)

Linear regression                               Number of obs     =      7,400
                                                F(1, 7398)        =     358.48
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0893
                                                Root MSE          =     .31714

------------------------------------------------------------------------------
             |               Robust
    NewsOrgs | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |   .3509963   .0185384    18.93   0.000     .3146559    .3873368
       _cons |   1.130801   .0288676    39.17   0.000     1.074212    1.187389
------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress NewsOrgs SocJusValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robust  
(sum of wgt is 6,710.25460426805)

Linear regression                               Number of obs     =      6,669
                                                F(6, 6662)        =     146.53
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1706
                                                Root MSE          =     .30322

------------------------------------------------------------------------------
             |               Robust
    NewsOrgs | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |   .3670507   .0195358    18.79   0.000     .3287542    .4053472
         Age |   .0287697   .0055914     5.15   0.000     .0178088    .0397305
FemaleGender |  -.0891993   .0108325    -8.23   0.000    -.1104345   -.0679642
    Graduate |   .1129234   .0111638    10.12   0.000     .0910388    .1348081
      Income |   .0383546   .0058767     6.53   0.000     .0268345    .0498748
       BIPOC |   .0018241    .012006     0.15   0.879    -.0217115    .0253596
       _cons |   1.200671   .0314862    38.13   0.000     1.138948    1.262394
------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress NewsOrgs LibValues SocJusValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robust 
(sum of wgt is 6,710.25460426805)

Linear regression                               Number of obs     =      6,669
                                                F(7, 6661)        =     165.20
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2198
                                                Root MSE          =     .29411

------------------------------------------------------------------------------
             |               Robust
    NewsOrgs | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .4912642   .0372964    13.17   0.000     .4181513    .5643771
SocJusValues |    .086038   .0298784     2.88   0.004     .0274668    .1446093
         Age |   .0427102   .0055465     7.70   0.000     .0318373    .0535831
FemaleGender |  -.0802458   .0105424    -7.61   0.000    -.1009124   -.0595793
    Graduate |   .0870816   .0107108     8.13   0.000      .066085    .1080781
      Income |    .031534   .0056239     5.61   0.000     .0205093    .0425586
       BIPOC |   .0023049   .0116084     0.20   0.843    -.0204513    .0250612
       _cons |   .8736051   .0392703    22.25   0.000     .7966227    .9505874
------------------------------------------------------------------------------

. eststo
(est5 stored)

. esttab

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
                 NewsOrgs        NewsOrgs        NewsOrgs        NewsOrgs        NewsOrgs   
--------------------------------------------------------------------------------------------
LibValues           0.565***        0.568***                                        0.491***
                  (25.95)         (24.03)                                         (13.17)   

Age                                0.0438***                       0.0288***       0.0427***
                                   (7.94)                          (5.15)          (7.70)   

FemaleGender                      -0.0752***                      -0.0892***      -0.0802***
                                  (-7.23)                         (-8.23)         (-7.61)   

Graduate                           0.0874***                        0.113***       0.0871***
                                   (8.15)                         (10.12)          (8.13)   

Income                             0.0303***                       0.0384***       0.0315***
                                   (5.42)                          (6.53)          (5.61)   

BIPOC                             0.00719                         0.00182         0.00230   
                                   (0.62)                          (0.15)          (0.20)   

SocJusValues                                        0.351***        0.367***       0.0860** 
                                                  (18.93)         (18.79)          (2.88)   

_cons               0.796***        0.878***        1.131***        1.201***        0.874***
                  (22.90)         (22.25)         (39.17)         (38.13)         (22.25)   
--------------------------------------------------------------------------------------------
N                    7404            6669            7400            6669            6669   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. eststo clear

. 
. regress BranchesOfGov LibValues [pweight=V200010b], robust 
(sum of wgt is 7,426.32858054501)

Linear regression                               Number of obs     =      7,421
                                                F(1, 7419)        =     114.05
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0294
                                                Root MSE          =     .22705

------------------------------------------------------------------------------
             |               Robust
BranchesOf~v | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .1724136   .0161444    10.68   0.000     .1407659    .2040613
       _cons |    1.55899   .0251159    62.07   0.000     1.509756    1.608224
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress BranchesOfGov LibValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robust 
(sum of wgt is 6,717.14043227229)

Linear regression                               Number of obs     =      6,673
                                                F(6, 6666)        =      76.92
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1278
                                                Root MSE          =      .2166

------------------------------------------------------------------------------
             |               Robust
BranchesOf~v | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .1744299   .0176948     9.86   0.000     .1397424    .2091173
         Age |   .0285634   .0043965     6.50   0.000     .0199449    .0371819
FemaleGender |  -.0171826   .0082587    -2.08   0.038    -.0333723   -.0009929
    Graduate |   .0642506   .0083912     7.66   0.000     .0478012    .0806999
      Income |   .0392405   .0049743     7.89   0.000     .0294893    .0489917
       BIPOC |  -.0424395   .0095121    -4.46   0.000    -.0610862   -.0237928
       _cons |   1.571459   .0284729    55.19   0.000     1.515643    1.627275
------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress BranchesOfGov SocJusValues [pweight=V200010b], robust 
(sum of wgt is 7,419.33868626837)

Linear regression                               Number of obs     =      7,417
                                                F(1, 7415)        =      24.39
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0066
                                                Root MSE          =      .2298

------------------------------------------------------------------------------
             |               Robust
BranchesOf~v | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |   .0659714    .013359     4.94   0.000     .0397841    .0921588
       _cons |   1.722788    .020691    83.26   0.000     1.682227    1.763348
------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress BranchesOfGov SocJusValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robust 
(sum of wgt is 6,717.14043227229)

Linear regression                               Number of obs     =      6,673
                                                F(6, 6666)        =      64.30
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1103
                                                Root MSE          =     .21877

------------------------------------------------------------------------------
             |               Robust
BranchesOf~v | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |   .0800772   .0144599     5.54   0.000     .0517312    .1084232
         Age |   .0231002   .0044267     5.22   0.000     .0144225    .0317779
FemaleGender |  -.0186624   .0084385    -2.21   0.027    -.0352046   -.0021202
    Graduate |    .075477   .0084055     8.98   0.000     .0589994    .0919545
      Income |   .0416178   .0050573     8.23   0.000     .0317039    .0515316
       BIPOC |  -.0402634   .0097202    -4.14   0.000    -.0593182   -.0212086
       _cons |   1.713098   .0232186    73.78   0.000     1.667582    1.758614
------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress BranchesOfGov LibValues SocJusValues Age FemaleGender Graduate Income BIPOC [pweight=V200010b], robus
> t 
(sum of wgt is 6,717.14043227229)

Linear regression                               Number of obs     =      6,673
                                                F(7, 6665)        =      66.07
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1288
                                                Root MSE          =     .21649

------------------------------------------------------------------------------
             |               Robust
BranchesOf~v | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .2097073   .0288609     7.27   0.000     .1531307     .266284
SocJusValues |  -.0397115   .0234136    -1.70   0.090    -.0856096    .0061865
         Age |   .0290603   .0043639     6.66   0.000     .0205056     .037615
FemaleGender |  -.0148445   .0083777    -1.77   0.076    -.0312676    .0015786
    Graduate |   .0644005    .008376     7.69   0.000     .0479809    .0808201
      Income |   .0386734   .0049718     7.78   0.000      .028927    .0484198
       BIPOC |  -.0402056   .0095848    -4.19   0.000    -.0589948   -.0214164
       _cons |   1.573322   .0283314    55.53   0.000     1.517783     1.62886
------------------------------------------------------------------------------

. eststo
(est5 stored)

. esttab

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
             BranchesOf~v    BranchesOf~v    BranchesOf~v    BranchesOf~v    BranchesOf~v   
--------------------------------------------------------------------------------------------
LibValues           0.172***        0.174***                                        0.210***
                  (10.68)          (9.86)                                          (7.27)   

Age                                0.0286***                       0.0231***       0.0291***
                                   (6.50)                          (5.22)          (6.66)   

FemaleGender                      -0.0172*                        -0.0187*        -0.0148   
                                  (-2.08)                         (-2.21)         (-1.77)   

Graduate                           0.0643***                       0.0755***       0.0644***
                                   (7.66)                          (8.98)          (7.69)   

Income                             0.0392***                       0.0416***       0.0387***
                                   (7.89)                          (8.23)          (7.78)   

BIPOC                             -0.0424***                      -0.0403***      -0.0402***
                                  (-4.46)                         (-4.14)         (-4.19)   

SocJusValues                                       0.0660***       0.0801***      -0.0397   
                                                   (4.94)          (5.54)         (-1.70)   

_cons               1.559***        1.571***        1.723***        1.713***        1.573***
                  (62.07)         (55.19)         (83.26)         (73.78)         (55.53)   
--------------------------------------------------------------------------------------------
N                    7421            6673            7417            6673            6673   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.1.log
  log type:  text
 closed on:  12 May 2025, 18:03:36
---------------------------------------------------------------------------------------------------------------
